<?php

$file = $_GET["file"];

if(file_exists($file)) {
	$ext = substr($file, strrpos($file, ".")+1);
	ob_start ("ob_gzhandler");
	header("Content-Type: image/$ext");
	header("Cache-Control: must-revalidate");
	$offset = 60 * 60 * 24 * 7;
	$ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
	$LastModStr = "Last-Modified: " . gmdate("D, d M Y H:i:s", time()) . " GMT";
	header($ExpStr);
	header($LastModStr);
	
	echo file_get_contents($file);
}

?>